package org.liu.nasaapp;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.*;

public class ShowDescription extends Activity 
{
	  private String titel = null;
	  private String pubdate = null;
	  private String theStory = null;

    public void onCreate(Bundle icicle) 
    {
        super.onCreate(icicle);
        setContentView(R.layout.showdescription);

            		 Intent startingIntent = getIntent();
            	        
            	        if (startingIntent != null)
            	        {
            	        	Bundle b = startingIntent.getBundleExtra("android.intent.extra.INTENT");
            	        	if (b == null)
            	        	{
            	        		theStory = "bad bundle?";
            	        	}
            	        	else
            	    		{	
            	        		titel = b.getString( "title" );
            	        		pubdate = b.getString( "pubdate" ).substring( 5, 24 );
            	        		theStory = b.getString("description").replace('\n',' ') + "\n\nMore information:\n" + b.getString("link");
            	        		
            	    		}
            	        }
            	        else
            	        {	
            	        	theStory = "Information Not Found.";
            	        
            	        }
            	        
            	        TextView tt= (TextView) findViewById(R.id.itemTitel1);
            	        TextView tp= (TextView) findViewById(R.id.itemPublicDate1);
            	        TextView ts= (TextView) findViewById(R.id.storybox1);
            	        tt.setText(titel);
            	        tp.setText( pubdate );
            	        ts.setText(theStory);
            	

       
        
    }
	}
    
  
    	  
	  
